package net.zigin.nhi.could.waste.service.impl;

import net.zigin.commons.util.ParamsMapUtil;
import net.zigin.commons.util.ReflectUtil;
import net.zigin.nhi.could.waste.model.AreaCity;
import net.zigin.nhi.could.waste.vo.AreaRegionVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import net.zigin.nhi.could.waste.dao.BaseMapper;
import net.zigin.nhi.could.waste.dao.AreaRegionMapper;
import net.zigin.nhi.could.waste.model.AreaRegion;
import net.zigin.nhi.could.waste.service.AreaRegionService;

import java.util.List;

/*#################################################################*
# 说明:以下代码通过哲勤代码生成工具自动生成    
# 工具:GeneratorCode
# 作者:mgw1986                                                  
# 生成时间:2021-9-9 21:00:33                                               
##################################################################*/


/**
 * AreaRegion服务实现类
 *
 * @author mgw1986
 * @version V1.0
 * @ClassName: AreaRegionServiceImpl
 * @date 2021-9-9 21:00:33
 */
@Service
public class AreaRegionServiceImpl extends AbstractServiceImpl<AreaRegion, String> implements AreaRegionService {
    @Autowired
    private AreaRegionMapper areaRegionMapper;

    @Override
    public BaseMapper<AreaRegion, String> getMapper() {
        return areaRegionMapper;
    }

    @Override
    public List<AreaRegionVo> getListByCityCode(String cityCode) {
        ParamsMapUtil.ParamMap<String, Object> paramMap = ParamsMapUtil.getInstance().addParam("cityCode", cityCode);
        List<AreaRegion> areaRegions = areaRegionMapper.selectListByCondition(paramMap);
        return ReflectUtil.copyProperties(areaRegions, AreaRegionVo.class);
    }
}